{template header}
{template detail_common}
<div class="wrapper">
    <div class="goods-detail-attr">
    	<div class="goods-image"><img src="$post[image]"></div>
        <div class="goods-attr">
        	<h3>$post[title]</h3>
            {loop $post[postdata][goodsattr] $attr}
            <div class="item"><div class="name">$attr[name]</div><div class="value">$attr[value]</div></div>
            {/loop}
        </div>
        <div class="goods-detail-bar">
              <span>浏览:$post[views]</span>
            <a href="javascript:;" onclick="Favorite($post[id])">收藏本商品</a>
            {if $allowdelpost}<a href="javascript:;" onclick="deletePost($post[id])">删除</a>{/if}
            {if $alloweditpost}<a href="/?mod=post&act=editpost&id=$post[id]">编辑</a>{/if}
            {if $allowauditpost}
            <a href="javascript:;" onclick="setPostState($post[id],0)">通过审核</a> 
            <a href="javascript:;" onclick="setPostState($post[id],2)">取消审核</a>
            {/if}
        </div>
    </div>
    <div class="blank"></div>
    <div class="goods-detail-content" id="goods-detail-content">
    	<div class="tabs">
        	<span class="cur">宝贝详细</span>
            <span>累计评论</span>
        </div>
        <div class="goods-detail content-item">$post[content]</div>
        <!--评论-->
        <div class="content-item" style="display:none;">
        {if $post[allowcomment]}
        {if $allowcomment}
        <div class="post-comment-form">
            <form method="post" name="formcomment">
            <textarea class="comment-textarea" name="message" id="comment-text" placeholder="在这里输入评论内容"{if !$G[islogin]} disabled{/if}></textarea>
            <div class="comment-toolbar"><input type="button" class="comment-publish" id="comment-publish" value="发布"><span>已有<font node="comments">$post[comments]</font>条评论</span></div>
            </form>
            {if !$G[islogin]}<div class="errortips" style="display:block;"><i class="icon">&#xf0142;</i>登录后才能发评论哦，亲.</div>{/if}
            <div class="errortips" id="comment-tips"><i class="icon">&#xf0142;</i>不能发空评论哦，亲.</div>
        </div>
        {/if}
        <h3 class="post-comment-title">最新评论</h3>
        <div class="comment-loading" id="comment-loading"><img src="/static/images/common/loading16.gif"> 正在加载评论...</div>
        <div id="post-comment-list-content"></div>
        {else}
        <div style="padding:30px; font-size:16px; color:#666; text-align:center;">沙发空缺中。。。</div>
        {/if}
        </div>
    </div>
</div>
<script type="text/javascript">
(function(){
var tabs = $("#goods-detail-content>.tabs").find("span");
var contents = $("#goods-detail-content").find(".content-item");
tabs.click(function(){
	$(this).addClass('cur').siblings().removeClass('cur');
	contents.eq($(this).index()).show().siblings('.content-item').hide();
});
})();
</script>
<script type="text/javascript" src="/static/js/postdetail.js"></script>
{template footer}